package org.xiaojl.modules.sys.entity;

import org.xiaojl.common.base.BaseEntity;
import org.xiaojl.utils.ToolUtil;

import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;

/**
 * <p>
 * 系统日志表
 * </p>
 *
 * @author xiaojl
 * @since 2017-08-21
 */
@TableName("sys_log")
public class SysLog extends BaseEntity<SysLog> {

    private static final long serialVersionUID = 1L;

    /**
     * 登陆名
     */
	private String loginName;
    /**
     * 真实名
     */
	private String realName;
    /**
     * 内容
     */
	private String optContent;
    /**
     * 客户端ip
     */
	private String clientIp;
	/**
	 * 操作结果
	 */
	private String resultText;
	
	private String resultCode;
	/**
	 * 请求耗时
	 */
	private Long requestTime;

	@Override
	public Wrapper<SysLog> bindingQueryWrapper() {
		Wrapper<SysLog> wrapper = new EntityWrapper<SysLog>();
		if(ToolUtil.isNotEmpty(this.loginName)){
			wrapper.like("loginName", this.loginName);
		}
		if(ToolUtil.isNotEmpty(this.realName)){
			wrapper.like("realName", this.realName);
		}
		if(ToolUtil.isNotEmpty(this.optContent)){
			wrapper.like("optContent", this.optContent);
		}
		if(ToolUtil.isNotEmpty(this.clientIp)){
			wrapper.like("clientIp", this.clientIp);
		}
		if(ToolUtil.isNotEmpty(this.resultText)){
			wrapper.like("resultText", this.resultText);
		}
		if(ToolUtil.isNotEmpty(this.resultCode)){
			wrapper.like("resultCode", this.resultCode);
		}
		return wrapper;
	}

	
	public String getResultText() {
		return resultText;
	}

	public void setResultText(String resultText) {
		this.resultText = resultText;
	}

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}

	public Long getRequestTime() {
		return requestTime;
	}

	public void setRequestTime(Long requestTime) {
		this.requestTime = requestTime;
	}
	
	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public String getOptContent() {
		return optContent;
	}

	public void setOptContent(String optContent) {
		this.optContent = optContent;
	}

	public String getClientIp() {
		return clientIp;
	}

	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}


	@Override
	public String toString() {
		return "SysLog [id=" + id + ", createBy=" + createBy + ", createTime="
				+ createTime + ", delFlag=" + delFlag + ", loginName="
				+ loginName + ", realName=" + realName + ", optContent="
				+ optContent + ", clientIp=" + clientIp + ", resultText="
				+ resultText + ", resultCode=" + resultCode + ", requestTime="
				+ requestTime + "]";
	}

}
